<template>
    <div>
        <a-alert message="个人基本信息" type="info" />
        <a-form :form="form" >
        <a-row :gutter="48" >
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考生姓名"
                >
                    <a-input  v-decorator="[
                    'ksxm',
                    {
                        rules: [{ required: true, message: '请输入考生姓名!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考生姓名拼音"
                >
                    <a-input  v-decorator="[
                    'ksxmpy',
                    {
                        rules: [{ required: true, message: '请输入考生姓名拼音!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
            <a-form-item
                label="性别"
              >
                <a-select allowClear v-decorator="['xbm',
                  {
                    rules: [{ required: true, message: '请选择性别!' }],
                  }]"  :disabled="disabledStop">
                  <a-select-option v-for="i in TYPE0011" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="出生日期"
                >
                <a-date-picker v-decorator="['csrq',
                    {
                        rules: [{ required: true, message: '请选择出生日期!' }],
                    }]" :disabled="disabledStop"/>
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="民族"
                >
                    <a-select v-decorator="['mz',
                    {
                        rules: [{ required: true, message: '请选择民族!' }],
                    }]" :disabled="disabledStop" >
                    <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="婚姻状况"
                >
                    <a-select v-decorator="['hyzk',
                    {
                        rules: [{ required: true, message: '请选择民族!' }],
                    }]" :disabled="disabledStop" >
                    <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="24" :sm="24">
                <a-form-item
                    label="政治面貌"
                >
                    <a-select v-decorator="['zzmm',
                    {
                        rules: [{ required: true, message: '请选择民族!' }],
                    }]" :disabled="disabledStop" >
                    <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col :lg="16" :md="24" :sm="24">
                <a-form-item
                    label="户口所在地"
                >
                <a-row :gutter="0">
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['hkszd',
                        {
                            rules: [{ required: true, message: '请选择户口所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['hkszdp',
                        {
                            rules: [{ required: true, message: '请选择户口所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['hkszdc',
                        {
                            rules: [{ required: true, message: '请选择户口所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                </a-row>
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="24" :sm="24">
                <a-form-item
                    label="户口所在地详细地址"
                >
                <a-input  v-decorator="[
                    'hkszxxdz',
                    {
                        rules: [{ required: true, message: '请输入户口所在地详细地址!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="16" :md="24" :sm="24">
                <a-form-item
                    label="档案所在地"
                >
                <a-row :gutter="0">
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['daszd',
                        {
                            rules: [{ required: true, message: '请选择档案所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['daszdp',
                        {
                            rules: [{ required: true, message: '请选择档案所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                    <a-col :md="8" :sm="8">
                        <a-select v-decorator="['daszdc',
                        {
                            rules: [{ required: true, message: '请选择档案所在地!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-col>
                </a-row>
                </a-form-item>
            </a-col>
            <a-col :lg="12" :md="24" :sm="24">
                <a-form-item
                    label="档案所在单位"
                >
                <a-input  v-decorator="[
                    'daszdw',
                    {
                        rules: [{ required: true, message: '请输入档案所在单位!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="12" :md="24" :sm="24">
                <a-form-item
                    label="档案所在单位地址"
                >
                <a-input  v-decorator="[
                    'daszdwdz',
                    {
                        rules: [{ required: true, message: '请输入档案所在单位地址!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="档案所在单位邮政编码"
                >
                <a-input  v-decorator="[
                    'daszdyzbm',
                    {
                        rules: [{ required: true, message: '请输入档案所在单位邮政编码!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考生通讯地址"
                >
                    <a-input  v-decorator="[
                    'kstxdz',
                    {
                        rules: [{ required: true, message: '请输入考生通讯地址!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="固定电话:(格式如:020-57890329)"
                >
                    <a-input  v-decorator="[
                    'gddh',
                    {
                        rules: [{ required: true, message: '请输入固定电话!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="移动电话"
                >
                    <a-input  v-decorator="[
                    'yddh',
                    {
                        rules: [{ required: true, message: '请输入移动电话!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="电子信箱"
                >
                    <a-input  v-decorator="[
                    'dzxx',
                    {
                        rules: [{ required: true, message: '请输入电子信箱!' }],
                    }
                    ]" :disabled="disabledStop" />
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="12" :sm="24">
                <a-form-item
                    label="考生来源"
                >
                    <a-select v-decorator="['ksly',
                    {
                        rules: [{ required: true, message: '请选择考生来源!' }],
                    }]" :disabled="disabledStop" >
                    <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col :lg="8" :md="24" :sm="24">
                <a-form-item
                    label="考试方式"
                >
                    <a-select v-decorator="['ksfs',
                    {
                        rules: [{ required: true, message: '请选择考试方式!' }],
                    }]" :disabled="disabledStop" >
                    <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="获学士学位单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hxsxwdw',
                            {
                                rules: [{ required: true, message: '请选择获学士学位单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hxsxwdwsub',
                            {
                                rules: [{ required: true, message: '请选择获学士学位单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获学士学位专业"
                    >
                        <a-select v-decorator="['hxsxwzy',
                        {
                            rules: [{ required: true, message: '请选择获学士学位专业!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                 <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获学士学位年月"
                    >
                    <a-month-picker v-decorator="['hxsxwny',
                        {
                            rules: [{ required: true, message: '请选择获学士学位年月!' }],
                        }]" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获学士学位证书编号"
                    >
                        <a-input  v-decorator="[
                        'hxsxwzsbh',
                        {
                            rules: [{ required: true, message: '请输入获学士学位证书编号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="本科毕业单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['bkbydw',
                            {
                                rules: [{ required: true, message: '请选择本科毕业单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['bkbydwsub',
                            {
                                rules: [{ required: true, message: '请选择本科毕业单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="本科毕业专业"
                    >
                        <a-select v-decorator="['bkbyzy',
                        {
                            rules: [{ required: true, message: '请选择本科毕业专业!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="本科毕业年月"
                    >
                    <a-month-picker v-decorator="['bkbyny',
                        {
                            rules: [{ required: true, message: '请选择本科毕业年月!' }],
                        }]" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="本科毕业证书编号"
                    >
                        <a-input  v-decorator="[
                        'bkbyzsbh',
                        {
                            rules: [{ required: true, message: '请输入本科毕业证书编号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获得本科证书形式"
                    >
                        <a-select v-decorator="['hdbkzsxs',
                        {
                            rules: [{ required: true, message: '请选择获得本科证书形式!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="获硕士学位单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hssxwdw',
                            {
                                rules: [{ required: true, message: '请选择获硕士学位单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['hssxwdwsub',
                            {
                                rules: [{ required: true, message: '请选择获硕士学位单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获硕士学位年月"
                    >
                    <a-month-picker v-decorator="['hssxwny',
                        {
                            rules: [{ required: true, message: '获请选择获硕士学位年月!' }],
                        }]" :disabled="disabledStop"/>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="获硕士学位专业"
                    >
                        <a-select v-decorator="['hssxwzy',
                        {
                            rules: [{ required: true, message: '请选择获硕士学位专业!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获硕士学位证书编号"
                    >
                        <a-input  v-decorator="[
                        'hssxwzsbh',
                        {
                            rules: [{ required: true, message: '请输入获硕士学位证书编号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="获硕士学位方式"
                    >
                        <a-select v-decorator="['hssxxwfs',
                        {
                            rules: [{ required: true, message: '请选择获硕士学位方式!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="16" :md="16" :sm="24">
                    <a-form-item
                        label="硕士毕业单位"
                    >
                    <a-row :gutter="0">
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['ssbydw',
                            {
                                rules: [{ required: true, message: '请选择硕士毕业单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                        <a-col :md="12" :sm="12">
                            <a-select v-decorator="['ssbydwsub',
                            {
                                rules: [{ required: true, message: '请选择硕士毕业单位!' }],
                            }]" :disabled="disabledStop" >
                            <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                            </a-select>
                        </a-col>
                    </a-row>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="8" :sm="24">
                    <a-form-item
                        label="硕士毕业专业"
                    >
                        <a-select v-decorator="['ssbyzy',
                        {
                            rules: [{ required: true, message: '请选择硕士毕业专业!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                 <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="硕士毕业年月"
                    >
                    <a-month-picker v-decorator="['ssbyny',
                        {
                            rules: [{ required: true, message: '请选择硕士毕业年月!' }],
                        }]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="硕士毕业证书编号"
                    >
                        <a-input  v-decorator="[
                        'ssbyzsbh',
                        {
                            rules: [{ required: true, message: '请输入硕士毕业证书编号!' }],
                        }
                        ]" :disabled="disabledStop" />
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="最后学位"
                    >
                        <a-select v-decorator="['zhxw',
                        {
                            rules: [{ required: true, message: '请选择最后学位!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
                <a-col :lg="8" :md="12" :sm="24">
                    <a-form-item
                        label="最后学历"
                    >
                        <a-select v-decorator="['zhxl',
                        {
                            rules: [{ required: true, message: '请选择最后学历!' }],
                        }]" :disabled="disabledStop" >
                        <a-select-option v-for="i in TYPE0321" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
                        </a-select>
                    </a-form-item>
                </a-col>
        </a-row>
        </a-form>
    </div>
</template>

<script>
import { mapState } from 'vuex'

const selectArr = ['TYPE0126', 'TYPE0075', 'TYPE0125', 'TYPE0072']

export default {
  props: {
    confirmHandleVisiable: {
      default: false
    },
    info: {
      default: () => ({})
    },
    // 是否禁止编辑
    disabledStop: {
      default: true
    }
  },
  data () {
    return {
      loading: false,
      selectMenu: {
        yx: [] // 院系
      }
    }
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  computed: {
    ...mapState({
      systemInfo: state => state.app.systemInfo,
      TYPE0321: state => state.app['TYPE0321'], // 是否在岗
      TYPE0126: state => state.app['TYPE0126'], // 年级
      TYPE0011: state => state.app['TYPE0011'] // 性别
    })
  },
  created () {
    this.initSelectMenu()
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
    for (let key in this.info) {
      this.form.getFieldDecorator(key, {initialValue: this.info[key]})
    }
  },
  methods: {
    initSelectMenu () {
      let allRequest = [
        this.$api.base.collegeAll()
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          yx: res[0].data
        }
      })
    },
    // 关闭
    onClose () {
      this.$emit('close')
    },
    // 输出当前数据
    GetInfo () {
      let ret = true
      this.form.validateFields((err, values) => {
        if (err) {
          ret = false
        }
      })
      if (ret) {
        return this.form.getFieldsValue()
      } else {
        return null
      }
    }
  }
}
</script>

<style lang="less">
.fullscreen{
    .ant-drawer-wrapper-body{
        height: 100%;
        overflow: auto;
    }
}
</style>
